import java.awt.Color;
import java.awt.Dialog;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Insets;

public class JAPI_Dialog extends Dialog
{
	private static final long serialVersionUID = -8417240192131084262L;
	
	Insets inset;
	boolean resizable=true;

	public JAPI_Dialog(Frame parent,String title)
	{
		super(parent,title,false);
		addNotify();   // WICHTIG (win32 jdk1.1) !!!!
		this.setLayout(new JAPI_Fixlayout());
	}

	public void setResizable(boolean set)
	{
		resizable=set;
		repaint(-1);
	}

	public void paint(Graphics g)
	{
	    if(isResizable()!=resizable)
	    	super.setResizable(resizable);
	}

	public void setEnabled(boolean enable) {
		for(int i=0;i<getComponentCount();i++)
			getComponent(i).setEnabled(enable);
	}

	public void setInsets(int t, int b, int l, int r)
	{
		inset = new Insets(t,l,b,r);
	}

	public Insets getInsets()
	{
		if(inset != null)
			return(inset);
		else
			return(super.getInsets());
	}

	public void setFont(Font f)
    {
   		super.setFont(f);
		for(int i=0;i<getComponentCount();i++)
			if(getComponent(i).isDisplayable())
				getComponent(i).setFont(f);
    }

	public void setBackground(Color c)
    {
    	super.setBackground(c);
 		for(int i=0;i<getComponentCount();i++)
			getComponent(i).setBackground(c);
    }

}
